/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkRtspPublisherSource.h"
#include "MkRtspSession.h"
#include "MkUtil/MkLog.h"

CMkRtspPublisherSource::CMkRtspPublisherSource(CMkRtspSession* pSession)
    : CMkRtspStreamSource(MkMediaSourceRtmpPublisher)
    , m_pSession(pSession)
{

}

Uint32 CMkRtspPublisherSource::SessionRemoved()
{
    m_pSession = nullptr;
    return NoneError;
}

Uint32 CMkRtspPublisherSource::StopMediaSource()
{
    if (m_pSession) {
        m_pSession->Close();
    }
    return NoneError;
}

CMkRtspPublisherSource::~CMkRtspPublisherSource()
{
    m_pSession = nullptr;
}